<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>The GdkPixbuf Structure</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="The gdk-pixbuf Library">
<link rel="up" href="rn01.html" title="API Reference">
<link rel="prev" href="gdk-pixbuf-Versioning.html" title="Initialization and Versions">
<link rel="next" href="gdk-pixbuf-refcounting.html" title="Reference Counting and Memory Mangement">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="rn01.html" title="API Reference">
<link rel="reference" href="rn02.html" title="Tools Reference">
<link rel="index" href="api-index-full.html" title="Index of all symbols">
<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
<link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
<link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
<link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
<link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
<link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
<link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
<link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
<link rel="appendix" href="apa.html" title="Appendix A. Porting applications from Imlib to gdk-pixbuf">
<link rel="appendix" href="license.html" title="Appendix B. License">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-pixbuf-Versioning.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">The gdk-pixbuf Library</th>
<td><a accesskey="n" href="gdk-pixbuf-refcounting.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-pixbuf-gdk-pixbuf.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#gdk-pixbuf-gdk-pixbuf.description" class="shortcut">Description</a>
                 | 
                <a href="#gdk-pixbuf-gdk-pixbuf.object-hierarchy" class="shortcut">Object Hierarchy</a>
                 | 
                <a href="#gdk-pixbuf-gdk-pixbuf.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-pixbuf-gdk-pixbuf.top_of_page"></a>The GdkPixbuf Structure</span></h2>
<p>The GdkPixbuf Structure — Information that describes an image.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk-pixbuf-gdk-pixbuf.synopsis"></a><h2>Synopsis</h2>
<a name="GdkPixbuf"></a><pre class="synopsis">

#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;

enum                <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufError" title="enum GdkPixbufError">GdkPixbufError</a>;
#define             <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR--CAPS" title="GDK_PIXBUF_ERROR">GDK_PIXBUF_ERROR</a>
enum                <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace" title="enum GdkColorspace">GdkColorspace</a>;
enum                <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufAlphaMode" title="enum GdkPixbufAlphaMode">GdkPixbufAlphaMode</a>;
                    <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf-struct" title="GdkPixbuf">GdkPixbuf</a>;
<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace" title="enum GdkColorspace">GdkColorspace</a>       <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-colorspace" title="gdk_pixbuf_get_colorspace ()">gdk_pixbuf_get_colorspace</a>           (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int                 <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-n-channels" title="gdk_pixbuf_get_n_channels ()">gdk_pixbuf_get_n_channels</a>           (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-has-alpha" title="gdk_pixbuf_get_has_alpha ()">gdk_pixbuf_get_has_alpha</a>            (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int                 <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-bits-per-sample" title="gdk_pixbuf_get_bits_per_sample ()">gdk_pixbuf_get_bits_per_sample</a>      (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"
>guchar</a> *            <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-pixels" title="gdk_pixbuf_get_pixels ()">gdk_pixbuf_get_pixels</a>               (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int                 <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-width" title="gdk_pixbuf_get_width ()">gdk_pixbuf_get_width</a>                (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int                 <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-height" title="gdk_pixbuf_get_height ()">gdk_pixbuf_get_height</a>               (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
int                 <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-rowstride" title="gdk_pixbuf_get_rowstride ()">gdk_pixbuf_get_rowstride</a>            (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);
const <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *       <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-option" title="gdk_pixbuf_get_option ()">gdk_pixbuf_get_option</a>               (<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                                         const <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *key);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
   +----GdkPixbuf
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--bits-per-sample" title='The "bits-per-sample" property'>bits-per-sample</a>"          <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--colorspace" title='The "colorspace" property'>colorspace</a>"               <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace" title="enum GdkColorspace">GdkColorspace</a>         : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--has-alpha" title='The "has-alpha" property'>has-alpha</a>"                <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>              : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--height" title='The "height" property'>height</a>"                   <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--n-channels" title='The "n-channels" property'>n-channels</a>"               <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--pixels" title='The "pixels" property'>pixels</a>"                   <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a>              : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--rowstride" title='The "rowstride" property'>rowstride</a>"                <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only
  "<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf--width" title='The "width" property'>width</a>"                    <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf.description"></a><h2>Description</h2>
<p>
    The <span class="structname">GdkPixbuf</span> structure contains
    information that describes an image in memory.
  </p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="image-data"></a>Image Data</h2></div></div></div>
<p>
      Image data in a pixbuf is stored in memory in uncompressed,
      packed format.  Rows in the image are stored top to bottom, and
      in each row pixels are stored from left to right.  There may be
      padding at the end of a row.  The "rowstride" value of a pixbuf,
      as returned by <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#gdk-pixbuf-get-rowstride" title="gdk_pixbuf_get_rowstride ()"><code class="function">gdk_pixbuf_get_rowstride()</code></a>, indicates the number
      of bytes between rows.
    </p>
<div class="example">
<a name="put-pixel"></a><p class="title"><b>Example 1. put_pixel() example</b></p>
<div class="example-contents">
<p>
	The following code illustrates a simple put_pixel()
	function for RGB pixbufs with 8 bits per channel with an alpha
	channel.  It is not included in the gdk-pixbuf library for
	performance reasons; rather than making several function calls
	for each pixel, your own code can take shortcuts.
      </p>
<pre class="programlisting">
static void
put_pixel (GdkPixbuf *pixbuf, int x, int y, guchar red, guchar green, guchar blue, guchar alpha)
{
  int width, height, rowstride, n_channels;
  guchar *pixels, *p;
  n_channels = gdk_pixbuf_get_n_channels (pixbuf);
  g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
  g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
  g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
  g_assert (n_channels == 4);
  width = gdk_pixbuf_get_width (pixbuf);
  height = gdk_pixbuf_get_height (pixbuf);
  g_assert (x &gt;= 0 &amp;&amp; x &lt; width);
  g_assert (y &gt;= 0 &amp;&amp; y &lt; height);
  rowstride = gdk_pixbuf_get_rowstride (pixbuf);
  pixels = gdk_pixbuf_get_pixels (pixbuf);
  p = pixels + y * rowstride + x * n_channels;
  p[0] = red;
  p[1] = green;
  p[2] = blue;
  p[3] = alpha;
}
      </pre>
<p>
	This function will not work for pixbufs with images that are
	other than 8 bits per sample or channel, but it will work for
	most of the pixbufs that GTK+ uses.
      </p>
</div>
</div>
<br class="example-break"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
	If you are doing <code class="function">memcpy()</code> of raw pixbuf data, note that the
	last row in the pixbuf may not be as wide as the full
	rowstride, but rather just as wide as the pixel data needs to
	be.  That is, it is unsafe to do <code class="literal">memcpy (dest,
	pixels, rowstride * height)</code> to copy a whole pixbuf.
	Use <a class="link" href="gdk-pixbuf-creating.html#gdk-pixbuf-copy" title="gdk_pixbuf_copy ()"><code class="function">gdk_pixbuf_copy()</code></a> instead, or compute the width in bytes
	of the last row as <code class="literal">width * ((n_channels *
	bits_per_sample + 7) / 8)</code>.
      </p>
</div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="GdkPixbufError"></a><h3>enum GdkPixbufError</h3>
<pre class="programlisting">typedef enum {
        /* image data hosed */
        GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
        /* no mem to load image */
        GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
        /* bad option passed to save routine */
        GDK_PIXBUF_ERROR_BAD_OPTION,
        /* unsupported image type (sort of an ENOSYS) */
        GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
        /* unsupported operation (load, save) for image type */
        GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
        GDK_PIXBUF_ERROR_FAILED
} GdkPixbufError;
</pre>
<p>
An error code in the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ERROR--CAPS" title="GDK_PIXBUF_ERROR"><span class="type">GDK_PIXBUF_ERROR</span></a> domain. Many <span class="application">gdk-pixbuf</span>
operations can cause errors in this domain, or in the <a
href="/usr/share/gtk-doc/html/glib/glib-File-Utilities.html#G-FILE-ERROR--CAPS"
><span class="type">G_FILE_ERROR</span></a>
domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-PIXBUF-ERROR-CORRUPT-IMAGE--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ERROR_CORRUPT_IMAGE</code></span></p></td>
<td>An image file was broken somehow.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ERROR-INSUFFICIENT-MEMORY--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY</code></span></p></td>
<td>Not enough memory.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ERROR-BAD-OPTION--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ERROR_BAD_OPTION</code></span></p></td>
<td>A bad option was passed to a pixbuf save module.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ERROR-UNKNOWN-TYPE--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ERROR_UNKNOWN_TYPE</code></span></p></td>
<td>Unknown image type.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ERROR-UNSUPPORTED-OPERATION--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION</code></span></p></td>
<td>Don't know how to perform the
given operation on the type of image at hand.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ERROR-FAILED--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ERROR_FAILED</code></span></p></td>
<td>Generic failure code, something went wrong.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GDK-PIXBUF-ERROR--CAPS"></a><h3>GDK_PIXBUF_ERROR</h3>
<pre class="programlisting">#define GDK_PIXBUF_ERROR gdk_pixbuf_error_quark ()
</pre>
<p>
Error domain used for pixbuf operations. Indicates that the error code
will be in the <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbufError" title="enum GdkPixbufError"><span class="type">GdkPixbufError</span></a> enumeration. See <a
href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> for
information on error domains and error codes.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkColorspace"></a><h3>enum GdkColorspace</h3>
<pre class="programlisting">typedef enum {
	GDK_COLORSPACE_RGB
} GdkColorspace;
</pre>
<p>
    This enumeration defines the color spaces that are supported by
    the <span class="application">gdk-pixbuf</span> library.  Currently only RGB is supported.
  </p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><a name="GDK-COLORSPACE-RGB--CAPS"></a><span class="term"><code class="literal">GDK_COLORSPACE_RGB</code></span></p></td>
<td>Indicates a red/green/blue additive color space.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbufAlphaMode"></a><h3>enum GdkPixbufAlphaMode</h3>
<pre class="programlisting">typedef enum
{
        GDK_PIXBUF_ALPHA_BILEVEL,
        GDK_PIXBUF_ALPHA_FULL
} GdkPixbufAlphaMode;
</pre>
<p>
    These values can be passed to
    <a
href="/usr/share/gtk-doc/html/gdk/gdk-Pixbufs.html#gdk-pixbuf-render-to-drawable-alpha"
><code class="function">gdk_pixbuf_render_to_drawable_alpha()</code></a> to control how the alpha
    channel of an image should be handled.  This function can create a
    bilevel clipping mask (black and white) and use it while painting
    the image.  In the future, when the X Window System gets an alpha
    channel extension, it will be possible to do full alpha
    compositing onto arbitrary drawables.  For now both cases fall
    back to a bilevel clipping mask.
  </p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-PIXBUF-ALPHA-BILEVEL--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ALPHA_BILEVEL</code></span></p></td>
<td>A bilevel clipping mask (black and white)
will be created and used to draw the image.  Pixels below 0.5 opacity
will be considered fully transparent, and all others will be
considered fully opaque.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ALPHA-FULL--CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ALPHA_FULL</code></span></p></td>
<td>For now falls back to <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GDK-PIXBUF-ALPHA-BILEVEL--CAPS"><span class="type">GDK_PIXBUF_ALPHA_BILEVEL</span></a>.
In the future it will do full alpha compositing.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf-struct"></a><h3>GdkPixbuf</h3>
<pre class="programlisting">typedef struct _GdkPixbuf GdkPixbuf;</pre>
<p>
    This is the main structure in the <span class="application">gdk-pixbuf</span> library.  It is
    used to represent images.  It contains information about the
    image's pixel data, its color space, bits per sample, width and
    height, and the rowstride (the number of bytes between the start of
    one row and the start of the next).
  </p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-colorspace"></a><h3>gdk_pixbuf_get_colorspace ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace" title="enum GdkColorspace">GdkColorspace</a>       gdk_pixbuf_get_colorspace           (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the color space of a pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Color space.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-n-channels"></a><h3>gdk_pixbuf_get_n_channels ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_get_n_channels           (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the number of channels of a pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Number of channels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-has-alpha"></a><h3>gdk_pixbuf_get_has_alpha ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gdk_pixbuf_get_has_alpha            (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries whether a pixbuf has an alpha channel (opacity information).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if it has an alpha channel, <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> otherwise.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-bits-per-sample"></a><h3>gdk_pixbuf_get_bits_per_sample ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_get_bits_per_sample      (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the number of bits per color sample in a pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Number of bits per color sample.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-pixels"></a><h3>gdk_pixbuf_get_pixels ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar"
>guchar</a> *            gdk_pixbuf_get_pixels               (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries a pointer to the pixel data of a pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A pointer to the pixbuf's pixel data.  Please see <a class="xref" href="gdk-pixbuf-gdk-pixbuf.html#image-data" title="Image Data">the section called “Image Data”</a>
for information about how the pixel data is stored in
memory.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-width"></a><h3>gdk_pixbuf_get_width ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_get_width                (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the width of a pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Width in pixels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-height"></a><h3>gdk_pixbuf_get_height ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_get_height               (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the height of a pixbuf.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Height in pixels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-rowstride"></a><h3>gdk_pixbuf_get_rowstride ()</h3>
<pre class="programlisting">int                 gdk_pixbuf_get_rowstride            (const <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre>
<p>
Queries the rowstride of a pixbuf, which is the number of bytes between the start of a row
and the start of the next row.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> A pixbuf.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Distance between row starts.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gdk-pixbuf-get-option"></a><h3>gdk_pixbuf_get_option ()</h3>
<pre class="programlisting">const <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *       gdk_pixbuf_get_option               (<a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf,
                                                         const <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *key);</pre>
<p>
Looks up <em class="parameter"><code>key</code></em> in the list of options that may have been attached to the
<em class="parameter"><code>pixbuf</code></em> when it was loaded, or that may have been attached by another
function using <a class="link" href="gdk-pixbuf-Module-Interface.html#gdk-pixbuf-set-option" title="gdk_pixbuf_set_option ()"><code class="function">gdk_pixbuf_set_option()</code></a>.
</p>
<p>
For instance, the ANI loader provides "Title" and "Artist" options. 
The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot 
options for cursor definitions. The PNG loader provides the tEXt ancillary
chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders
return an "orientation" option string that corresponds to the embedded 
TIFF/Exif orientation tag (if present).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td> a <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
<td> a nul-terminated string.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the value associated with <em class="parameter"><code>key</code></em>. This is a nul-terminated 
string that should not be freed or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if <em class="parameter"><code>key</code></em> was not found.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="gdk-pixbuf-gdk-pixbuf.property-details"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--bits-per-sample"></a><h3>The <code class="literal">"bits-per-sample"</code> property</h3>
<pre class="programlisting">  "bits-per-sample"          <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only</pre>
<p>
The number of bits per sample.
Currently only 8 bit per sample are supported.</p>
<p>
</p>
<p>Allowed values: [1,16]</p>
<p>Default value: 8</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--colorspace"></a><h3>The <code class="literal">"colorspace"</code> property</h3>
<pre class="programlisting">  "colorspace"               <a class="link" href="gdk-pixbuf-gdk-pixbuf.html#GdkColorspace" title="enum GdkColorspace">GdkColorspace</a>         : Read / Write / Construct Only</pre>
<p>The colorspace in which the samples are interpreted.</p>
<p>Default value: GDK_COLORSPACE_RGB</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--has-alpha"></a><h3>The <code class="literal">"has-alpha"</code> property</h3>
<pre class="programlisting">  "has-alpha"                <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>              : Read / Write / Construct Only</pre>
<p>Whether the pixbuf has an alpha channel.</p>
<p>Default value: FALSE</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--height"></a><h3>The <code class="literal">"height"</code> property</h3>
<pre class="programlisting">  "height"                   <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only</pre>
<p>The number of rows of the pixbuf.</p>
<p>Allowed values: &gt;= 1</p>
<p>Default value: 1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--n-channels"></a><h3>The <code class="literal">"n-channels"</code> property</h3>
<pre class="programlisting">  "n-channels"               <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only</pre>
<p>
The number of samples per pixel. 
Currently, only 3 or 4 samples per pixel are supported.</p>
<p>
</p>
<p>Allowed values: &gt;= 0</p>
<p>Default value: 3</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--pixels"></a><h3>The <code class="literal">"pixels"</code> property</h3>
<pre class="programlisting">  "pixels"                   <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a>              : Read / Write / Construct Only</pre>
<p>A pointer to the pixel data of the pixbuf.</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--rowstride"></a><h3>The <code class="literal">"rowstride"</code> property</h3>
<pre class="programlisting">  "rowstride"                <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only</pre>
<p>
The number of bytes between the start of a row and 
the start of the next row. This number must (obviously)
be at least as large as the width of the pixbuf.</p>
<p>
</p>
<p>Allowed values: &gt;= 1</p>
<p>Default value: 1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GdkPixbuf--width"></a><h3>The <code class="literal">"width"</code> property</h3>
<pre class="programlisting">  "width"                    <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only</pre>
<p>The number of columns of the pixbuf.</p>
<p>Allowed values: &gt;= 1</p>
<p>Default value: 1</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>
